	{template 'header', 'member'}
    <!--right start-->
    <div class="right layout-right fn-right">
        <p class="tips bd-gray c666">专用于广大企业用户发布广告信息。</p>
        <!--main-block start-->
        <div class="main-block bd-gray mt10">
            <div class="hd fn-clear">
                <h2 class="fn-left">广告发布</h2>
            </div>
            <ul id="data-nav" class="main-nav mt10 fn-clear">
                <li><a href="ad.php?action=add">购买广告位</a></li>
                <li class="current"><a href="ad.php">编辑广告位</a></li>
            </ul>

            <!--购买广告位 start-->
            <form id="ad-edit-form" action="ad.php" method="post">
            <input type="hidden" name="action" value="edit">
            <input type="hidden" name="payid" value="{$payid}">
            <table class="data-form con">
                <tbody>
                <tr>
                    <th width="100">广告位：</th>
                    <td width="600">{$p['type']} {$p[name]} [{$p['typename']}]</td>
                </tr>
                <tr>
                    <th>投放时间段：</th>
                    <td>{timetodate($payInfo[starttime], 3)}至{timetodate($payInfo[overtime], 3)}</td>
                </tr>
                <tr class="tb-hd">
                    <th>广告设置</th>
                    <th></th>
                </tr>
                <tr>
                    <th>广告介绍：</th>
                    <td><input type="text" name="post[0]['name']" size="40" title="请输入简单的广告介绍"></td>
                </tr>
                <tr>
                    <th><span class="cred">*</span> 图片地址：</th>
                    <td>{Post::picture($moduleid, 'thumb', "post[0][img]", $thumb ,$p['width'], $p['height'])}
                    </td>
                </tr>
                <tr>
                    <th><span class="cred">*</span> 链接地址：</th>
                    <td><input type="text" size="40" class="easyui-validatebox" title="请填写链接地址" name="post[0]['linkurl]"></td>
                </tr>
                {if $areaids}
                {loop $areaids $areaid}
                <tr class="tb-hd">
                    <th>{$AREA[$areaid]['areaname']}站设置</th>
                    <th>
                        <label class="fn-left"><input type="checkbox" class="jsDefault nobd fn-left mr5" checked>启用默认设置</label>
                    </th>
                </tr>
                <tr>
                    <th>广告介绍：</th>
                    <td><input type="text" name="post[{$areaid}]['name']" size="40" title="请输入简单的广告介绍"></td>
                </tr>
                <tr>
                    <th><span class="cred">*</span> 图片地址：</th>
                    <td>{Post::picture($moduleid, 'thumb', "post[$areaid][img]", $thumb ,$p['width'], $p['height'])}
                    </td>
                </tr>
                <tr>
                    <th><span class="cred">*</span> 链接地址：</th>
                    <td><input type="text" size="40" class="easyui-validatebox" title="请填写链接地址" name="post[{$areaid}]['linkurl]"></td>
                </tr>
                {/loop}
                {/if}
                <tr class="tb-sbt">
                    <th></th>
                    <td><br><br><button name="submit" id="ad-edit-sbt" type="submit" class="btn">保存</button> </td>
                </tr>
                </tbody>
            </table>
            </form>
            <script>
                seajs.use(['$','easyui','easyui-css','easyui-icon-css'],function($){
                    $("#ad-edit-sbt").click(function(){
                        $('.easyui-validatebox').each(function(){
                            var title = $(this).attr("title");
                            $(this).validatebox({
                                required:true,
                                missingMessage:title
                            });
                        });
                        return $("#ad-edit-form").form('validate');
                    });
                })
            </script>
            <!--购买广告位 end-->
        </div>
        <!--main-block end-->
    </div>
    <!--right end-->
    {template 'footer', $module}